package com.songtech.server.constant.enumConstant;

/**
 * Created with IntelliJ IDEA.
 * Description: 命令枚举
 *
 * @Author: rentie
 * @Date: 2018/4/25 15:37
 **/
public enum  CmdEnum {
    CHANGE_CONTROL_PASSWORD("更改控制密码", "S1"),
    SET_CENTRAL_NUMBER("设置中心号码", "S2"),
    SET_AUTHORIZATION_NUMBER("设置授权号码", "S3"),
    SET_ALARM_MODE("设定报警方式", "S18"),
    ALARM_SETTING("报警设定", "S19"),
    REMOTE_POWER_OUTAGE("远程断油断电", "S20"),
    SET_ELECTRONIC_FENCE_ALARM("设置电子围栏报警", "S21"),
    SET_MONITORING_CENTER_GPRS_SERVER_IP_PORT("设置监控中心GPRS、服务器IP地址、端口号", "S23"),
    SET_APN("设置APN", "S24"),
    RESTORE_FACTORY_SETTING("恢复出厂设置", "S25"),
    READ_DEVICE_STATUS("读取设备状态", "S26"),
    SET_OVERSPEED_ALARM("设置超速报警", "S33"),
    SET_RECORD_MODE("设置记录模式", "S34"),
    BASE_STATION_QUERY("基站查询", "S80"),
    SET_GPRS_UPLOAD_INTERVA("设置GPRS上传间隔", "D1"),
    MANDATORY_ORIENTATION("强制定位", "D2"),
    REBOOT("设备重启", "R1"),
    DIAL("拨打电话", "R8"),
    MODE_SWITCH("模式切换", "WKMD"),
    REMOTE_SHUTDOWN("远程关机", "PWOFF"),
    POSITION_NOTIFICATION("位置通知", "I0"),
    TERMINAL_TIMING("终端授时", "TIME"),
    SWITCHING_PROTOCOLS("协议切换", "PRTCL");


    String message;
    String cmd;

    CmdEnum(String message, String cmd) {
        this.message = message;
        this.cmd = cmd;
    }

   public static String queryMessage(String cmd){
        for (CmdEnum c : CmdEnum.values()) {
            if (c.cmd.equals(cmd)) {
                return c.message;
            }
        }
        return "未知命令";
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getCmd() {
        return cmd;
    }

    public void setCmd(String cmd) {
        this.cmd = cmd;
    }
}
